using System;
using EPiServer.Common;
using EPiServer.Common.Queries;
using EPiServer.Community.Forum;
using EPiServer.Community.Forum.Queries;

namespace EPiAbstractions.Community.Forum
{
    public interface IForumHandlerFacade
    {
        EPiServer.Community.Forum.Forum AddForum(EPiServer.Community.Forum.Forum forum);

        void UpdateForum(EPiServer.Community.Forum.Forum forum);

        void RemoveForum(EPiServer.Community.Forum.Forum forum);

        EPiServer.Community.Forum.Forum GetForum(Int32 forumId);

        ForumCollection GetForums();

        ForumCollection GetForums(SiteCollection sites);

        ForumCollection GetForums(SiteCollection sites, NullValueAction siteNullAction);

        StyleSheet AddStyleSheet(StyleSheet styleSheet);

        void UpdateStyleSheet(StyleSheet styleSheet);

        void RemoveStyleSheet(StyleSheet styleSheet);

        StyleSheet GetStyleSheet(Int32 styleSheetId);

        StyleSheetCollection GetStyleSheets();

        Icon AddIcon(Icon icon);

        void UpdateIcon(Icon icon);

        void RemoveIcon(Icon icon);

        Icon GetIcon(Int32 iconId);

        IconCollection GetIcons();

        Reply AddReply(Reply reply);

        void UpdateReply(Reply reply);

        void RemoveReply(Reply reply);

        Reply GetReply(Int32 replyId);

        MessageCollection GetReplies(Topic topic, Int32 page, Int32 pageSize, ReplySortOrder[] order);

        MessageCollection GetReplies(Topic topic, Int32 page, Int32 pageSize, out Int32 totalItems, ReplySortOrder[] order);

        Int32 GetListingPageNumber(Reply reply, Int32 pageSize, ReplySortOrder[] sortOrder);

        ChildRoom ConvertToChildRoom(Room room, RoomBase parentRoom);

        Room ConvertToRootRoom(ChildRoom room, EPiServer.Community.Forum.Forum forum);

        RoomBase AddRoom(RoomBase room);

        void UpdateRoom(RoomBase room);

        void RemoveRoom(RoomBase room);

        RoomBase GetRoom(Int32 roomId);

        RoomBase GetPreviousRoom(RoomBase currentRoom);

        RoomBase GetNextRoom(RoomBase currentRoom);

        RoomCollection GetRooms(EPiServer.Community.Forum.Forum forum);

        RoomCollection GetRooms(RoomBase parentRoom);

        Topic AddTopic(Topic topic);

        void UpdateTopic(Topic topic);

        void IncrementViews(Topic topic);

        Topic MoveTopic(Topic topic, RoomBase toRoom, TopicTrace trace);

        void RemoveTopic(Topic topic);

        Topic GetTopic(Int32 topicId);

        MessageCollection GetTopics(Int32 page, Int32 pageSize, TopicSortOrder[] order);

        MessageCollection GetTopics(Int32 page, Int32 pageSize, out Int32 totalItems, TopicSortOrder[] order);

        MessageCollection GetTopics(RoomCollection rooms, Int32 page, Int32 pageSize, TopicSortOrder[] order);

        MessageCollection GetTopics(RoomCollection rooms, Int32 page, Int32 pageSize, out Int32 totalItems, TopicSortOrder[] order);

        Int32 GetListingPageNumber(Topic topic, Int32 pageSize, TopicSortOrder[] sortOrder);

        Int32 GetListingPageNumber(RoomCollection rooms, Topic topic, Int32 pageSize, TopicSortOrder[] sortOrder);

        event EPiServerCommonEventHandler ForumAdded;

        event EPiServerCommonEventHandler ForumUpdated;

        event EPiServerCommonEventHandler ForumRemoved;

        event EPiServerCommonEventHandler IconAdded;

        event EPiServerCommonEventHandler IconUpdated;

        event EPiServerCommonEventHandler IconRemoved;

        event EPiServerCommonEventHandler ReplyAdded;

        event EPiServerCommonEventHandler ReplyUpdated;

        event EPiServerCommonEventHandler ReplyRemoved;

        event EPiServerCommonEventHandler RoomAdded;

        event EPiServerCommonEventHandler RoomUpdated;

        event EPiServerCommonEventHandler RoomRemoved;

        event EPiServerCommonEventHandler StyleSheetAdded;

        event EPiServerCommonEventHandler StyleSheetUpdated;

        event EPiServerCommonEventHandler StyleSheetRemoved;

        event EPiServerCommonEventHandler TopicAdded;

        event EPiServerCommonEventHandler TopicUpdated;

        event EPiServerCommonEventHandler TopicRemoved;

        event EPiServerCommonEventHandler TopicMoved;

        ForumCollection GetQueryResult(ForumQuery query);

        ForumCollection GetQueryResult(ForumQuery query, Int32 page, Int32 pageSize);

        ForumCollection GetQueryResult(ForumQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        RoomCollection GetQueryResult(RoomQuery query);

        RoomCollection GetQueryResult(RoomQuery query, Int32 page, Int32 pageSize);

        RoomCollection GetQueryResult(RoomQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        MessageCollection GetQueryResult(TopicQuery query);

        MessageCollection GetQueryResult(TopicQuery query, Int32 page, Int32 pageSize);

        MessageCollection GetQueryResult(TopicQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        MessageCollection GetQueryResult(ReplyQuery query);

        MessageCollection GetQueryResult(ReplyQuery query, Int32 page, Int32 pageSize);

        MessageCollection GetQueryResult(ReplyQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);
    }
}